package jmine.tec.datadigester.positional.meta.factory;

import java.beans.PropertyDescriptor;

import jmine.tec.datadigester.positional.annotations.PositionalTimestampEntry;
import jmine.tec.datadigester.positional.meta.PositionalFieldMetadata;
import jmine.tec.datadigester.positional.meta.PositionalTimestampFieldMetadata;

/**
 * {@link PositionalFieldAnnotationSupport} para writers de campos TimeStamp
 * 
 * @author israel.crisanto
 */
public class PositionalTimestampAnnotationSupport implements PositionalFieldAnnotationSupport<PositionalTimestampEntry> {

    /**
     * {@inheritDoc}
     */
    public PositionalFieldMetadata create(PropertyDescriptor property, PositionalTimestampEntry a) {
        return new PositionalTimestampFieldMetadata(property, a.description(), a.start(), a.size(), a.format());
    }

    /**
     * {@inheritDoc}
     */
    public Class<PositionalTimestampEntry> annotationClass() {
        return PositionalTimestampEntry.class;
    }
}
